<template>
    <canvas id="myCanvas" style="border: 1px solid;"></canvas>
</template>
  
<script setup lang="ts">
import { onMounted } from 'vue';

function draw() {
    const canvas = document.getElementById('myCanvas');
    if (canvas?.getContext) {
        const ctx = canvas.getContext('2d');
        ctx.fillStyle = 'gray';
        ctx.fillRect(25, 25, 100, 100);
        ctx.clearRect(45, 45, 60, 60);
        ctx.strokeRect(50, 50, 50, 50);
    }
}

onMounted(() => {
    draw();
})
</script>
